
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>电子图书列表</title>
    <!--引入css支持-->
    <link rel="stylesheet" href="/statics/css/bootstrap.min.css" />
    <!--如果要引用js要先引入支持-->
    <script type="text/javascript" src="/statics/js/jquery-2.1.0.min.js"></script>
</head>
<body>
<div class="container">
    <!--上-->
    <div class="row" style="margin-top: 20px;">
        <div class="col-sm-3" >43
            <h4 >销售信息查询:</h4>
        </div>
        <div class="col-md-6 col-md-offset-6">
            <form action="/sale/list" method="post" class="form-inline">
                <input type="hidden" value="1" name="pageNo">
                <div class="form-group">
                    <label for="salequery" style="font-weight: 500; font-size: 18px;">图书分类:</label>
                    <select id="salequery" name="salequery" style="width: 130px; height: 30px;" >
                        <option value="0">全部</option>
                        <c:forEach items="${pageInfo.list}" var="dept">
                            <option value="${dept.ebookCategory.id}"></option>
                        </c:forEach>
                    </select>
                    <button type="submit" class="btn btn-default">查询</button>
                    <a href="${pageContext.request.contextPath}/jsp/appinfoadd.jsp" class="btn btn-success btn-sm">新增信息</a>
                </div>
            </form>
        </div>
    </div>
    <!--下-->
    <div class="row">
        <div class="col-sm-12" >
            <table class="table table-bordered  table-hover">
                <tr class="info text-center">
                    <th>图书标号</th>
                    <th>图书名称</th>
                    <th>图书摘要</th>
                    <th>上传人</th>
                    <th>上传时间</th>
                    <th>操作</th>
                </tr>
                <c:if test="${ not empty pageInfo}">
                    <c:forEach var="sale" items="${pageInfo.list}">
                        <tr class=" text-center">
                            <td>${sale.id}</td>
                            <td>${sale.itle}</td>
                            <td>${sale.summary}</td>
                            <td>${sale.uploaduser}</td>
                            <td><fmt:formatDate value="${sale. createdate}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                            <td>
                                <a href="#">修改</a>
                                <a class="deleteEntry" href="javascript:(${sale.id});">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <div class="page-bar">
                            <ul class="page-num-ul clearfix">
                                <li>共${pageInfo.total }条记录&nbsp;&nbsp; ${pageInfo.pageNum }/${pageInfo.pages }页</li>
                                <c:if test="${pageInfo.pageNum > 1}">
                                    <a href="javascript:page_nav(document.forms[0],1);">首页</a>
                                    <a href="javascript:page_nav(document.forms[0],${pageInfo.pageNum-1})">上一页</a>
                                </c:if>
                                <c:if test="${pageInfo.pageNum < pageInfo.pages }">
                                    <a href="javascript:page_nav(document.forms[0],${pageInfo.pageNum+1} );">下一页</a>
                                    <a href="javascript:page_nav(document.forms[0],${pageInfo.pages });">最后一页</a>
                                </c:if>
                                &nbsp;&nbsp;
                            </ul>
                            <span class="page-go-form"><label for="inputPage">跳转至</label>
	     <input type="text" name="inputPage" id="inputPage" class="page-key" value="${pageInfo.pageNum}"/>页
	     <button type="button" class="page-btn"
                 onClick='jump_to(document.forms[0],document.getElementById("inputPage").value)'>GO</button>
		</span>
                        </div>
                    </tr>
                </c:if>

            </table>
            <!--<p style="font-weight: 700; font-size: 24px; text-align: center;">
                商品的库存数量是：<span>43</span>
            </p>-->
        </div>
    </div>
</div>
<script>


    //执行分页点击事件
    function page_nav(forms,pageNo){
        //给条件到后台的当前页表单项进行重新赋值
        forms.pageNo.value = pageNo;
        //2.提交表单
        forms.submit();
    }




</script>

</body>
</html>
